/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-core
 * Filename：	AStoreQueryParamConverter.java
 * Created：		2016年9月5日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.notice.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.communicate.converter.UCNConverter;
import com.thor.palmmall.rest.notice.ANoticeParam2;
import com.thor.palmmall.spi.notice.SNoticeParam2;

/**
 * @author wolv
 *
 */
public class SNoticeParamConverter2 implements Converter<ANoticeParam2, SNoticeParam2> {

  public static SNoticeParamConverter2 getInstance() {
    if (instance == null)
      instance = new SNoticeParamConverter2();
    return instance;
  }

  private static SNoticeParamConverter2 instance;

  private SNoticeParamConverter2() {
  }

  @Override
  public SNoticeParam2 convert(ANoticeParam2 source) {
    if (source == null)
      return null;

    SNoticeParam2 target = new SNoticeParam2();

    target.setContract(UCNConverter.getInstance().convert(source.getContract()));
    target.setNoticeUuid(source.getNoticeUuid());
    target.setNoticeVersion(source.getNoticeVersion());
    target.setReader(UCNConverter.getInstance().convert(source.getReader()));
    target.setTime(source.getTime());

    return target;
  }

}
